package com.wy.dto.common;

import java.io.Serializable;
import java.util.List;

/**
 * Created by clei on 15/9/21.
 */
public class BizDataDto<T> implements Serializable {
    /** 总页数 */
    private int total=0;
    /** 总记录数 */
    private int pageSize=10;
    /** 总记录数 */
    private int records=0;
    /** 具体数据 */
    private List<T> rows;

    public BizDataDto(){
    }

    public int getTotal() {
        if(records<pageSize){
            return 1;
        }else{
            return records/pageSize;
        }
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getRecords() {
        return records;
    }

    public void setRecords(int records) {
        this.records = records;
    }

    public List<T> getRows() {
        return rows;
    }

    public void setRows(List<T> rows) {
        this.rows = rows;
    }
}
